Skip to content

reflecting the EfficientAD integration, performance work, calibration, localization, Autopilot support, and testing fixes - #166

Merged
DeepKnowledge1 merged 47 commits into
mainfrom
feat/efficientad
Aug 28, 2026
Merged

reflecting the EfficientAD integration, performance work, calibration, localization, Autopilot support, and testing fixes#166
DeepKnowledge1 merged 47 commits into
mainfrom
feat/efficientad

Conversation

@DeepKnowledge1

Copy link
Copy Markdown
Owner

🔗 Related Issue

Fixes #

📝 Description

This PR adds EfficientAD support to AnomaVision and integrates it into the existing anomaly-detection pipeline alongside PaDiM and PatchCore.

🚀 EfficientAD

  • Added EfficientAD as a supported anomaly-detection algorithm.

  • Integrated EfficientAD with the existing algorithm abstraction used by PaDiM/PatchCore.

  • Reused the existing AnomaVision data loading and preprocessing pipeline.

  • Added batched training/inference to avoid unnecessary repeated computation.

  • Optimized teacher feature extraction and removed unnecessary inference-time computation.

  • Added calibrated anomaly thresholds based on normal training images only.

  • Added anomaly-map generation for pixel-level localization.

  • Reused the existing post-processing and visualization pipeline for:

    • anomaly heatmaps
    • localization masks
    • contours
    • bounding boxes
    • overlay visualizations

🔌 Deployment & Export

  • Added EfficientAD support to the existing model/export workflow.
  • Maintained compatibility with the existing ONNX-based detection flow.
  • Preserved the existing PaDiM/PatchCore inference architecture rather than introducing a separate EfficientAD pipeline.
  • Added EfficientAD support to Production Autopilot.
  • Autopilot can compare PaDiM, PatchCore, and EfficientAD candidates.
  • EfficientAD calibration data is preserved with the model artifact.

📊 Production Autopilot

  • Restored and preserved the rich production_autopilot_report.html dashboard.

  • Added EfficientAD to candidate comparison and model selection.

  • Report includes:

    • Image AUROC
    • Pixel AUROC
    • median latency
    • P95 latency
    • anomaly coverage
    • normal false-positive localization rate
    • threshold
    • selected model
    • deployment artifact
    • localization health
    • reproducibility information
  • Restored the existing timing/performance summary in the detection pipeline.

🐛 Fixes

  • Fixed EfficientAD training failure caused by PyTorch inference-mode tensors being used in autograd.
  • Fixed JSON serialization of NumPy/PyTorch scalar metrics in the Autopilot deployment manifest.
  • Restored Autopilot report/test compatibility.
  • Preserved existing helper APIs such as _format_metric.
  • Fixed report metric naming/capitalization expected by the test suite.

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📖 Documentation update
  • 🏗️ Infrastructure / CI/CD update

🧪 Hardware & Matrix Testing

I have successfully built and tested this code using uv on:

  • anomavision[cpu] (Standard/Edge)
  • anomavision[cu121] (CUDA 12.1)
  • anomavision[cu124] (CUDA 12.4)
  • anomavision[cu118] (CUDA 11.8)

Host OS used for testing:

  • Linux / Ubuntu
  • Windows (Native or WSL2)
  • macOS

🧪 Validation

  • Existing Autopilot unit tests updated/fixed.
  • EfficientAD-specific integration changes covered.
  • Autopilot report generation validated.
  • Deployment manifest generation validated.
  • Full uv run pytest suite verified on all supported environments.
  • Bottle dataset benchmark completed for PaDiM vs PatchCore vs EfficientAD.
  • Full ONNX/OpenVINO/TensorRT/Hailo hardware validation completed.

✅ Developer Checklist

  • My code follows the core style guidelines of this project (Ruff/Black formatting).
  • I have run uv run pytest and all unit tests pass locally.
  • Lockfile Guard: If I added or modified a dependency in pyproject.toml, I have run uv lock --python 3.10 and committed the updated uv.lock file.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the documentation accordingly (if applicable).

📸 Screenshots / Visual Proof

The Production Autopilot report now provides a rich HTML dashboard comparing PaDiM, PatchCore, and EfficientAD, including localization and deployment metrics.

Recommended screenshots:

  • production_autopilot_report.html
  • EfficientAD anomaly heatmap
  • EfficientAD localization mask/overlay
  • PaDiM vs PatchCore vs EfficientAD comparison
  • Autopilot model-selection summary

DeepKnowledge1 and others added 30 commits August 27, 2026 11:52
@DeepKnowledge1
DeepKnowledge1 merged commit f3ef9d2 into main Aug 28, 2026
5 checks passed
@DeepKnowledge1
DeepKnowledge1 deleted the feat/efficientad branch August 28, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant